package com.chenchen.tiguan.venue.service.impl;

import java.util.List;
import com.chenchen.tiguan.common.utils.DateUtils;
import com.chenchen.tiguan.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.chenchen.tiguan.venue.mapper.VenueOpenTimeMapper;
import com.chenchen.tiguan.venue.domain.VenueOpenTime;
import com.chenchen.tiguan.venue.service.IVenueOpenTimeService;

/**
 * 场馆每周固定开放时段Service业务层处理
 * 
 * @author chenchen
 * @date 2025-04-14
 */
@Service
public class VenueOpenTimeServiceImpl implements IVenueOpenTimeService 
{
    @Autowired
    private VenueOpenTimeMapper venueOpenTimeMapper;

    /**
     * 查询场馆每周固定开放时段
     * 
     * @param openTimeId 场馆每周固定开放时段主键
     * @return 场馆每周固定开放时段
     */
    @Override
    public VenueOpenTime selectVenueOpenTimeByOpenTimeId(Long openTimeId)
    {
        return venueOpenTimeMapper.selectVenueOpenTimeByOpenTimeId(openTimeId);
    }

    /**
     * 查询场馆每周固定开放时段列表
     * 
     * @param venueOpenTime 场馆每周固定开放时段
     * @return 场馆每周固定开放时段
     */
    @Override
    public List<VenueOpenTime> selectVenueOpenTimeList(VenueOpenTime venueOpenTime)
    {
        return venueOpenTimeMapper.selectVenueOpenTimeList(venueOpenTime);
    }

    /**
     * 新增场馆每周固定开放时段
     * 
     * @param venueOpenTime 场馆每周固定开放时段
     * @return 结果
     */
    @Override
    public int insertVenueOpenTime(VenueOpenTime venueOpenTime)
    {
        venueOpenTime.setCreateTime(DateUtils.getNowDate());
        venueOpenTime.setCreateBy(SecurityUtils.getUsername());
        return venueOpenTimeMapper.insertVenueOpenTime(venueOpenTime);
    }

    /**
     * 修改场馆每周固定开放时段
     * 
     * @param venueOpenTime 场馆每周固定开放时段
     * @return 结果
     */
    @Override
    public int updateVenueOpenTime(VenueOpenTime venueOpenTime)
    {
        venueOpenTime.setUpdateTime(DateUtils.getNowDate());
        venueOpenTime.setUpdateBy(SecurityUtils.getUsername());
        return venueOpenTimeMapper.updateVenueOpenTime(venueOpenTime);
    }

    /**
     * 批量删除场馆每周固定开放时段
     * 
     * @param openTimeIds 需要删除的场馆每周固定开放时段主键
     * @return 结果
     */
    @Override
    public int deleteVenueOpenTimeByOpenTimeIds(Long[] openTimeIds)
    {
        return venueOpenTimeMapper.deleteVenueOpenTimeByOpenTimeIds(openTimeIds);
    }

    /**
     * 删除场馆每周固定开放时段信息
     * 
     * @param openTimeId 场馆每周固定开放时段主键
     * @return 结果
     */
    @Override
    public int deleteVenueOpenTimeByOpenTimeId(Long openTimeId)
    {
        return venueOpenTimeMapper.deleteVenueOpenTimeByOpenTimeId(openTimeId);
    }
}
